#ifndef APPCONFIG_H
#define APPCONFIG_H

#include <QObject>
#include "AppCast.h"

#define _UNICAST_SERVER 0
class AppConfig : public QObject
{
    Q_OBJECT
public:
     AppConfig();
    ~AppConfig();

    static AppConfig* Instance();

    void InitConfig();

    void SetBroadCastIP(const QString& ip);
    QString BroadCastIP();

    void SetBroadCastPort(unsigned int port);
    unsigned int BroadCastPort();

    void SetLocalIP(QString& ip);
    QString LocalIP();


    ///.....



    const QString &MutiCastIP() const;

    void setMutiCastIP(const QString &newMutiCastIP);

    int MutiCastPort() const;
    void setMutiCastPort(int newMutiCastPort);


    const QString &TargetIP_UniCast() const;
    void setTargetIP_UniCast(const QString &newTargetIP_UniCast);

    int TargetPort_UniCast() const;
    void setTargetPort_UniCast(int newTargetPort_UniCast);

    int LocalPort_UniCast() const;
    void setLocalPort_UniCast(int newLocalPort_UniCast);



    enum CastType CastType() const;
    void setCastType(enum CastType newCastType);


    int localPort_Muticast() const;
    void setLocalPort_Muticast(int newLocalPort_Muticast);

private:
    QString m_LocalIP;

    //BroadCastConfig
    QString m_BroadCastIP;
    int m_BroadCastPort;

    //muticast Config
    QString m_MutiCastIP;
    int m_MutiCastPort;
    int m_localPort_Muticast;

    //unicast Config
    QString m_TargetIP_UniCast;
    int m_TargetPort_UniCast;
    int m_LocalPort_UniCast;

    enum CastType m_CastType;  

};

#endif // APPCONFIG_H
